﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using S.Authorization.API.Application.Command.MenuListCountCommand;

namespace S.Authorization.API.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class MenuListController : ControllerBase
    {
        private IMediator mediator;
        public MenuListController(IMediator _mediator)
        {
            this.mediator = _mediator;
        }
        /// <summary>
        /// 菜单+1
        /// </summary>
        /// <param name="MenuId"></param>
        /// <returns></returns>
        [HttpPost("GetMenulist")]
        public async Task<IActionResult> GetMenulist(int MenuId, string? Path)
        {
            return Ok(await mediator.Send(new MenuCountCommand() { MenuId = MenuId, Path = Path }));
        }
    }
}
